// MessageNotificationService.java
package net.web.service;

import net.web.dao.MessageNotificationDao;
import net.web.entity.MessageNotification;

import java.util.List;

public class MessageNotificationService {
    private MessageNotificationDao notificationDao = new MessageNotificationDao();

    public boolean sendNotification(MessageNotification notification) {
        return notificationDao.insert(notification);
    }

    public List<MessageNotification> getNotificationsByUserId(int userId) {
        return notificationDao.getNotificationsByUserId(userId);
    }

    public boolean markAsRead(int notificationId) {
        return notificationDao.markAsRead(notificationId);
    }

    public List<MessageNotification> getUnreadNotificationsByUserId(int userId) {
        return notificationDao.getUnreadNotificationsByUserId(userId);
    }
}